package com.lagou.homework_1;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class RankMapper extends Mapper<LongWritable, Text, RankBean, NullWritable> {
//    private IntWritable k = new IntWritable();
    private RankBean bean = new RankBean();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
//        k.set((int)key.get());
//        context.write(k, NullWritable.get());
        bean.setRaw_number(Integer.parseInt(value.toString()));
        context.write(bean, NullWritable.get());
    }
}
